home *** CD-ROM | disk | FTP | other *** search
- Path: news.infi.net!usenet
- From: nngis@norfolk.infi.net (Greg DiGiorgio)
- Newsgroups: comp.lang.c
- Subject: Re: ASCII value of a character
- Date: 3 Feb 1996 22:52:17 GMT
- Organization: Customer of InfiNet
- Message-ID: <4f0ov1$eca@nw002.infi.net>
- References: <Pine.SUN.3.91.960202222737.26868B-100000@parsifal.nando.net>
- NNTP-Posting-Host: h-lawnmowerman.norfolk.infi.net
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.3
-
- In article <Pine.SUN.3.91.960202222737.26868B-100000@parsifal.nando.net>,
- pretzel@nando.net says...
- >
- >How do you find the ascii value of a character? What I am actually
- >trying to do is read a tab from the keyboard and use it in a switch
- >statement. If the user hits tab, input a certain variable, etc. Also,
- >finding ascii values has infinite other uses.
- >
- > Pretzel <pretzel@nando.net>
-
- Pretzel,
-
- Here's some twisted logic for you...
-
- #include <stdio.h>
- main () {
- char c;
- printf("Enter a character: ");
- scanf("%1c",c);
- switch (c) {
- case 9: printf("You entered a TAB\n");
- break;
- default:break;
- }
- }
-
- Greg DiGiorgio
-
-